#include "path.h"
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>


namespace evm { namespace path {

bool exists(const char *path_name) {
    struct stat sbuf;
    return stat(path_name, &sbuf) == 0;
}

bool exists(std::string path_name) {
    return exists(path_name.data());
}

string getcwd() {
    auto buf = get_current_dir_name();
    string cwd(buf);
    free(buf);
    return cwd;
}

}}
